<template>
  <div class="myTable">
    <el-table :data="tableData" style="width: 100%">
      <el-table-column
        v-for="(labelItem, index) in labelList"
        :key="index"
        :prop="labelItem.propName"
        :label="labelItem.labelName"
      >
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  name: "ocn-table",
  props: {
    labelList: {
      type: Array,
      default() {
        return [
          {
            propName: "date",
            labelName: "日期",
          },
          {
            propName: "name",
            labelName: "姓名",
          },
          {
            propName: "address",
            labelName: "地址",
          },
        ];
      },
    },

    tableData: {
      type: Array,
      default() {
        return [
          {
            date: "2016-05-02",
            name: "王小虎",
            address: "上海市普陀区金沙江路 1518 弄",
          },
          {
            date: "2016-05-04",
            name: "王小虎",
            address: "上海市普陀区金沙江路 1517 弄",
          },
          {
            date: "2016-05-01",
            name: "王小虎",
            address: "上海市普陀区金沙江路 1519 弄",
          },
          {
            date: "2016-05-03",
            name: "王小虎",
            address: "上海市普陀区金沙江路 1516 弄",
          },
        ];
      },
    },
  },
  data() {
    return {};
  },
  created() {},
  mounted() {},
  methods: {},
};
</script>
<style lang="scss" scoped>
.myTable {
  background-color: #ffffff;
  width: 97%;
  height: 100%;
  /* stretch 属性标识按照对称轴垂直方向沾满容器 前提是容器没有设置对称轴垂直方向的具体距离属性 width/height*/
  align-self: stretch;
  padding: 1%;
  margin: 2px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: flex-start;
}
</style>